package com.example.chcrm.entity.vehicle;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.example.chcrm.entity.common.OperateRecord;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.NotBlank;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
import java.util.Map;

/**
 * @Author 邹
 * @Date 2025/4/20 23:01
 * @Version 1.0
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
public class ShipDeployInfo implements Serializable {
    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.INPUT)
    private String id;

    private String taskNumber;  //任务编号

    private String supplierId;      //供应商id
    private String supplierName;    //供应商名称
    @NotBlank(message = "船舶id不能为空")
    private String shipId;          //船舶id
    private String shipName;        //船舶名称
    private String voyageNumber;    //航次编号
    private String captainTel;      //船长电话
    private Integer loadingNum;     //预计装车数量
    private Integer leftoverNum;    //实际装车数量
    private Integer unloadedNumber;     //已卸数量
    private Integer status;         //状态 0：待执行 1：执行中 2：已完成

    //起始位置
    private String startId;     //起始地id
    private String startFullId; //起始地id(包含父级id)
    private String startName;   //起始地区域名
    private String startCoordinate; //起始地坐标
    @NotBlank(message = "起始港id不能为空")
    private String startPortId;     //起始港id
    private String startPortName;   //起始港名
    //到港位置
    private String deliveryId;      //交车地id
    private String deliveryFullId;  //交车地id(包含父级id)
    private String deliveryName;    //交车位置区域名
    private String deliveryCoordinate;  //交车位置坐标
    @NotBlank(message = "交车港id不能为空")
    private String deliveryPortId;      //交车港id
    private String deliveryPortName;    //交车港名

    private Integer isDeleted;  //是否删除  0：否 -1：是
    @TableField(fill = FieldFill.INSERT)
    private Date createTime;    //创建时间
    /**
     * 分页默认值
     */
    @TableField(exist = false)
    private Integer page = 1;
    @TableField(exist = false)
    private Integer rows = 10;
    @TableField(exist = false)
    private List<VehicleDeployCarCv> carList;   //调配委托车
    @TableField(exist = false)
    private List<OperateRecord> operateRecordList;  //操作记录

  /*  @TableField(exist = false)
    private WaterSupplierShip ship; //调配船舶
    @TableField(exist = false)
    private String leavePortName;   //出港码头
    @TableField(exist = false)
    private String sailingTime;     //出港时间*/

    @TableField(exist = false)
    private String startTime;//开始时间
    @TableField(exist = false)
    private String endTime;//结束时间
//    @TableField(exist = false)
//    private String startPortName;//起始港口
    @TableField(exist = false)
    private String endPortName;//结束港口
//    @TableField(exist = false)
//    private String deliveryPortName;//到达港口
    @TableField(exist = false)
    private Integer notUnloadedNumber;    //未卸数量
    @TableField(exist = false)
    private List<Map<String, Integer>> totalNumber;
    @TableField(exist = false)
    private String shipmasterName;
    @TableField(exist = false)
    private String shipmasterPhone;
    @TableField(exist = false)
    private String portNameRange;//拼接起始港和结束港


    @TableField(exist = false)
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date  startPlanDate;    //查询的计划时间区间开始
    @TableField(exist = false)
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date endPlanDate;  //查询的计划时间区间结束
    @TableField(exist = false)
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date  startOverDate;    //查询的计划时间区间开始
    @TableField(exist = false)
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date endOverDate;  //查询的计划时间区间结束
}